﻿using Jn698._45GWTool.ViewModels.Controls.DataControls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApp1.Controls
{
    /// <summary>
    /// CirclelButton.xaml 的交互逻辑
    /// </summary>
    public partial class CirclelButton : UserControl
    {
        public CirclelButton()
        {
            InitializeComponent();
            
        }

        /*public string Text
        {
            get { return (string)GetValue(TextProperty); }
            set { SetValue(TextProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Text.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty TextProperty =
            DependencyProperty.Register("Text", typeof(string), typeof(CirclelButton), new PropertyMetadata("Text",new PropertyChangedCallback(OnPropertyChangedCallback)));

        private static void OnPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (!(d is CirclelButton button))
            {
                return;
            }
            button.lab.Content = e.NewValue.ToString();
        }





        public new Brush Background
        {
            get { return (Brush)GetValue(BackgroundProperty); }
            set { SetValue(BackgroundProperty, value); }
        }

        // Using a DependencyProperty as the backing store for Background.  This enables animation, styling, binding, etc...
        public static new readonly DependencyProperty BackgroundProperty =
            DependencyProperty.Register("Background", typeof(Brush), typeof(CirclelButton), new PropertyMetadata(null,new PropertyChangedCallback(OnBackGroundPropertyChangedCallback)));

        private static void OnBackGroundPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            if (!(d is CirclelButton button)) return;
            if (!(e.NewValue is Brush brush)) return;
            button.border.Background = brush;
        }*/
    }
}
